The getQuantity method returns execution's original quantity.
var getQuantity();
This method returns a floating value representing execution's quantity.
The following example demonstrates the use of getQuantity() method.
function start()
{
//retrieve account's executions orders
var account = getAccount();
var executions = account.getExecutions(getSymbol());
//loop through all executions and calculate total and average quantity value
var totalQty = 0;
for(var i = 0; i < executions.length, i++)
{
var execution = executions[i];
totalQty += execution.getQuantity();
}
//calculate average quantity value for all executions
var avgQty = totalQty / executions.length;
Debug.writeLine("total quantity: " + totalQty + " average quantity: " + avgQty);
}
Copyright © 2006-2009 ActiveTick LLC